export interface reqBody<T> {
  code: number
  data: T
  message: string
  success: boolean
}
export interface loginData {
  token: string
}

export interface userInfo {
  avatar: string
  buttons: string[]
  name: string
  roles: string[]
  routes: string[]
}

export interface ITrademark {
  current: number
  pages: number
  records: TrademarkItem[]
  searchCount: boolean
  size: number
  total: number
}

export interface TrademarkItem {
  id?: number
  logoUrl: string
  tmName: string
}

// category-------------------------------------------
export interface Category {
  category1Id: string | number
  category2Id: string | number
  category3Id: string | number
  category1List: GoodItem[]
  category2List: GoodItem[]
  category3List: GoodItem[]
}

export interface GoodItem {
  category1Id?: number
  category2Id?: number
  id: number
  name: string
}

// attrs----------------------------------------
export interface AttrData {
  attrName: string
  attrValueList: AttrValueList[]
  categoryId: number
  categoryLevel: number
  id?: number | string
  skuIdAttrId?: string
}

export interface AttrValueList {
  attrId?: number
  id?: number
  valueName: string
  isEdit?: boolean
}

// SPU ------------------------------------------
export interface ISpuData {
  current: number
  pages: number
  records: ISpuListItem[]
  searchCount: boolean
  size: number
  total: number
}

export interface ISpuListItem {
  category3Id: number
  description: string
  id?: number
  spuImageList: spuImage[]
  spuName: string
  spuSaleAttrList: SpuSaleAttrItem[]
  tmId: number
}

export interface SpuSaleAttrItem {
  baseSaleAttrId: number
  id?: number
  saleAttrName: string
  spuId?: number
  spuSaleAttrValueList: SpuSaleAttrValueItem[]
  isInput?: boolean
  newAttrValueName?: string
  spuIdValueId?: string
}

export interface SpuSaleAttrValueItem {
  baseSaleAttrId: number
  id?: number
  isChecked?: null
  saleAttrName?: string
  saleAttrValueName: string
  spuId?: number
}

export interface spuImage {
  id?: number
  imgName?: string
  imgUrl?: string
  spuId?: number
}

export interface BaseSaleAttrValueName {
  id: number
  name: string
}

// sku ---------------------------------------

export interface ISkuList {
  current: number
  pages: number
  records: ISkuCommon[]
  searchCount: boolean
  size: number
  total: number
}

// 列表records + 详情 + 新增的data
export interface ISkuCommon {
  createTime?: string
  id?: number
  isSale?: number
  price: number | string
  skuName: string
  skuDesc: string
  weight: string
  spuId: number | string
  tmId: number | string
  category3Id: number
  skuDefaultImg: string
  skuSaleAttrValueList: ISkuSaleAttrValueList[]
  skuAttrValueList: ISkuAttrValueList[]
  skuImageList: ISkuImageList[]
}

export interface ISkuAttrValueList {
  attrId?: number | string
  attrName?: string
  id?: number
  skuId?: number
  valueId?: number | string
  valueName?: string
}

export interface ISkuImageList {
  id?: number
  spuId?: number
  imgName?: string
  imgUrl?: string
  isDefault?: boolean
  skuId?: number
  spuImgId?: number
}

export interface ISkuSaleAttrValueList {
  id?: number
  saleAttrId?: number | string
  saleAttrName?: string
  saleAttrValueId?: number | string
  saleAttrValueName?: string
  skuId?: number
  spuId?: number
}
